const router = require('express').Router()
var path = require('path')
const user = require('./user')
const perfume = require('./product/perfume')
const skincare = require('./product/skincare')

//香水页面
router.get('/perfume', (req, res) => {
    res.render('perfume.html', { title: 'HTML' })
})

//香水页面
router.post('/login', (req, res) => {
    user.login(req, res)
})

//护肤页面
router.get('/skincare', (req, res) => {
    res.render('skincare.html', { title: 'HTML' })
})
router.get('/currentGood', (req, res) => {
    res.render('currentGood.html', { title: 'HTML' })
})
//Brand Story页面
router.get('/brandStory', (req, res) => {
    res.render('Brand Story.html', { title: 'HTML' })
})
//Customized service页面
router.get('/customizedService', (req, res) => {
    res.render('Customized service.html', { title: 'HTML' })
})
//linkFive页面
router.get('/linkFive', (req, res) => {
    res.render('LinkFive.html', { title: 'HTML' })
})
//linkFour页面
router.get('/linkFour', (req, res) => {
    res.render('LinkFour.html', { title: 'HTML' })
})
//linkOne页面
router.get('/linkOne', (req, res) => {
    res.render('LinkOne.html', { title: 'HTML' })
})
//linkSeven
router.get('/linkSeven', (req, res) => {
    res.render('LinkSeven.html', { title: 'HTML' })
})
//LinkSix
router.get('/linkSix', (req, res) => {
    res.render('LinkSix.html', { title: 'HTML' })
})
//linkThree
router.get('/linkThree', (req, res) => {
    res.render('LinkThree.html', { title: 'HTML' })
})
//linkTwo
router.get('/linkTwo', (req, res) => {
    res.render('LinkTwo.html', { title: 'HTML' })
})
//memberCenter
router.get('/memberCenter', (req, res) => {
    res.render('Member Center.html', { title: 'HTML' })
})

//makeup
router.get('/makeup', (req, res) => {
    res.render('makeUp.html', { title: 'HTML' })
})

//handbook
router.get('/handbook', (req, res) => {
    res.render('handbook.html', { title: 'HTML' })
})

//makeup
router.get('/valentine', (req, res) => {
    res.render('valentine.html', { title: 'HTML' })
})

//首页
router.get('/', (req, res) => {
    res.render('index.html', { title: 'HTML' })
})


//获取所有香水商品
router.get('/getPerfumeList', (req, res) => {
    perfume.getPerfumeList(req, res)
})

//获取香水商品最大,最小价格
router.get('/getPrice', (req, res) => {
    perfume.getPriceBetween(req, res)
})

//获取所有香水商品
router.post('/getPerfume', (req, res) => {
    perfume.getPerfume(req, res, parseInt(req.body.id))
})

//获取所有香水商品
router.get('/getSkincareList', (req, res) => {
    skincare.getSkincareList(req, res)
})

//获取香水商品最大,最小价格
router.get('/getSkincarePriceBetween', (req, res) => {
    skincare.getSkincarePriceBetween(req, res)
})

//获取所有香水商品
router.post('/getSkincare', (req, res) => {
    skincare.getSkincare(req, res, parseInt(req.body.id))
})

module.exports = router